<!-- 模态框HTML -->
<form id="migration" method="post" action="__SELF__" class=" form-horizontal">
	<input type="hidden" name="status" value="{$order.status}">
	<input type="hidden" name="order_id" value="{$order.id}">
    <switch name="order.status">
		<case value="1">
			<div class="text-center">
				<h3 class="text-center">要确认取消订单吗？</h3>
				<button data-role="submit" class="btn btn-primary">确认</button>
				<button class="btn" data-dismiss="modal">取消</button>
			</div>
	    </case>
        <case value="2">
            <div class="form-group">
                <label class="col-sm-2">快递公司：</label>
                <div class="col-md-8">
                    <select class="form-control" name="ShipperValue">
                        <volist name="delivery" id="v">
                        <option value ="{$v.title},{$v.code}">{$v.title}</option>
                        </volist>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2">快递单号：</label>
                <div class="col-md-8">
                    <input type="text" class="form-control" name="LogisticCode">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2"></label>
                <div class="col-md-8 text-center">
                    <button data-role="submit" class="btn btn-primary">确认</button>
                    <button class="btn" data-dismiss="modal">取消</button>
                </div>
            </div>
        </case>
        <case value="3">
            <div class="is_confirm_box">
                <h3 class="text-center">要确认收货吗？</h3>
                <button data-role="submit" class="btn btn-primary send_box">确认</button>
                <button class="btn send_box" data-dismiss="modal">取消</button>
            </div>
        </case>
        <case value="8">
            <div class="form-group">
                <div class="col-md-3 left">拒绝原因：</div>
                <div class="col-md-8"><input type="text" class="form-control" name="refund_reason" ></div>
            </div>
            <div class="form-group">
                <div class="col-md-3 left"></div>
                <div class="col-md-8">
                    <button data-role="submit" class="btn btn-primary send_box">同意退款</button>
                    <button data-role="submit" class="btn btn-primary send_box">拒绝退款</button>
                </div>
            </div>
        </case>
	    <case value="10">
		    <div class="is_confirm_box">
			    <h3 class="text-center">要确认删除订单吗？</h3>
			    <input type="button" data-role="submit" value="确定" class="btn btn-primary send_box">
			    <input type="button" value="取消" class="btn send_box" data-dismiss="modal">
		    </div>
	    </case>
	    <default/>
		    <div class="form-group">
			    <div class="col-md-11 ">没有可以执行的相关操作</div>
		    </div>
    </switch>
</form>
<script>
    $(function(){
        $('[data-role="submit"]').click(function(e){
            e.preventDefault();
            var query=$('#migration').serialize();
            var url=$('#migration').attr('action');
            $.post(url,query,function(msg){
                if(msg.status){
                    toast.success(msg.info);
                    setTimeout(function(){
                        window.location.href=msg.url;
                    },1500);
                }else{
                    handleAjax(msg);
                }
            },'json');
        });
    });
</script>